package com.lstdemo.dao;

import com.lstdemo.domain.UserBean;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface Userdao {

    @Select("select * from tb_money")
    List<UserBean> selectAll();

    @Select("update tb_money set money =money + #{inMoney}  where name= #{username};")
    void inMoney(@Param("username") String username, @Param("inMoney") int inMoney);

    @Select("update tb_money set money =money- #{outMoney}  where name= #{username};")
    void outMoney(@Param("username")String username, @Param("outMoney") int outMoney);

}
